Skip to content

Add DandersFrames as an anchor parent; inherit anchor visibility#135

Open
UnderGut wants to merge 2 commits intoDaleHuntGB:mainfrom
UnderGut:anchor-dandersframes
Open

Add DandersFrames as an anchor parent; inherit anchor visibility#135
UnderGut wants to merge 2 commits intoDaleHuntGB:mainfrom
UnderGut:anchor-dandersframes

Conversation

@UnderGut
Copy link
Copy Markdown

Summary

Adds DandersFrames (CurseForge) as a selectable anchor parent in the custom viewer categories, so users can anchor BCDM bars (Custom / Additional Custom / Item / Items-Spells / Trinket) to their party/raid unit frames.

Changes

Core/Globals.lua

Added two anchor keys to the BCDM.AnchorParents table for the 5 custom viewer categories (Custom, AdditionalCustom, Item, Trinket, ItemSpell):

  • DandersPartyHeader — the party SecureGroupHeaderTemplate frame (auto-sized to the visible party frames).
  • DandersRaidFramesContainer — the raid container frame.

Both frames are top-level globals created by DandersFrames, so they resolve through the existing _G[Layout[2]] lookup with no additional load-order requirements. If DandersFrames isn't installed, the option is still shown but falls back to UIParent (see below).

CustomViewers/*.lua (5 files)

Two small robustness fixes applied uniformly to every anchorParent resolution site:

  1. or UIParent fallback — if the saved anchor key refers to a frame that no longer exists (e.g. user disabled the anchor addon), _G[key] returns nil; falling back to UIParent avoids SetParent(nil) / SetPoint(..., nil, ...) errors.

  2. container:SetParent(anchorParent) added next to each container:SetPoint(..., anchorParent, ...) call for the 5 viewer containers (CustomCooldownViewer, AdditionalCustomCooldownViewer, CustomItemBar, CustomItemSpellBar, TrinketBar).

    Re-parenting makes the BCDM container inherit visibility from the anchor. This is necessary for DandersFrames (the raid container is hidden in party mode and vice-versa), and it also aligns behavior with other addons that hide their frames conditionally. Icons previously remained visible in their old position even when the anchor frame was hidden.

Testing

  • Anchored the Custom bar to DandersFrames: Party Header / DandersFrames: Raid Container and verified it tracks the frames and hides together with them when switching DandersFrames profiles between party and raid modes.
  • Verified existing anchors (UIParent, PlayerFrame, TargetFrame, other BCDM bars, ElvUI frames) still work unchanged.
  • Verified no errors when switching profiles to one that references a missing anchor.

Notes

  • No new dependencies. DandersFrames is optional — if it's not installed, the options simply fall back to UIParent.
  • No saved-variable migration needed; this only adds new entries to the dropdown list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant